import { createRouter, createWebHistory } from 'vue-router'
import Index from '@/views/index/index.vue'
import Clazz from '@/views/clazz/index.vue'
import Stu from '@/views/stu/index.vue'
import Dept from '@/views/dept/index.vue'
import Emp from '@/views/emp/index.vue'
import EmpReport from '@/views/report/emp/index.vue'
import StuReport from '@/views/report/stu/index.vue'
import Log from '@/views/log/index.vue'
import Layout from '@/views/layout/index.vue'
import Login from '@/views/login/index.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      component: Layout,
      redirect: "/index",
      children: [ //children内所有路径对应的组件，都要显示到Layout内
        { path: "index", name: "index", component: Index },
        { path: "clazz", name: "clazz", component: Clazz },
        { path: "stu", name: "stu", component: Stu },
        { path: "dept", name: "dept", component: Dept },
        { path: "emp", name: "emp", component: Emp },
        { path: "report/emp", name: "empReport", component: EmpReport },
        { path: "report/stu", name: "stuReport", component: StuReport },
        { path: "log", name: "log", component: Log }
      ]
    },
    { path: "/login", name: "login", component: Login }
  ]
})

export default router